package correct.day23;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        HashSet<String> set = new HashSet<>();
        for(int i = 0; i < n; i++) {
            char[] ch = in.next().toCharArray();
            Arrays.sort(ch);
            set.add(new String(ch));
        }
        System.out.println(set.size());
    }
}
